
import { createStore } from 'vuex'

export default createStore({
  state: {
    'get_car_people_status_number': {},
    'get_alarm_status_number': {},
    'get_device_status_number': {},
    'alarm_info': {},
    'get_current_detect_accuracy': {},
    'get_new_detect_info': {},
    'get_device_status': [],
    'get_single_camera_detect_info':[],//首页中单个摄像头的实时报警信息
  },
  getters: {
    getCameraState: (state) => {
      console.log(state)
      return state['get_device_status']
    },
    getSorketData: (state) => (key) => {
      // console.log(state,key)
      return state[key]
    }
  },
  mutations: {
    setSorketData(state, { data, key }) {
      state[key] = data
    }
  },
  actions: {
    setSorketData({ commit }, data) {
      commit('setSorketData', data)
    }
  },
  modules: {
  }
})
